<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::get('/welcome_src/3',function(){
	return view('welcome_src.index_3');
});

//这是后台
Route::get('admin/index/index','Admin\IndexController@index');

//用户管理模块
Route::get('/admin/user/add', "Admin\UserController@add");
Route::post('/admin/user/insert', "Admin\UserController@insert");
Route::get('/admin/user/index', "Admin\UserController@index");
Route::get('/admin/user/edit/{id}', "Admin\UserController@edit");
Route::get('/admin/user/delete/{id}', "Admin\UserController@delete");
Route::post('/admin/user/update', "Admin\UserController@update");
Route::post('/admin/user/ajaxUpdate', "Admin\UserController@ajaxUpdate");
Route::post('/admin/user/ajaxUsername', "Admin\UserController@ajaxUsername");

//类别管理模块
Route::get('admin/cates/add','Admin\CatesController@add');
Route::post('admin/cates/insert','Admin\CatesController@insert');
Route::get('admin/cates/index','Admin\CatesController@index');
Route::get('admin/cates/edit/{id}','Admin\CatesController@edit');
Route::post('admin/cates/update','Admin\CatesController@update');
Route::get('admin/cates/delete/{id}','Admin\CatesController@delete');
Route::post('admin/cates/ajaxupdate','Admin\CatesController@ajaxupdate');

//管理员管理
Route::get('/admin/admins/add', 'Admin\AdminsController@add');
Route::post('/admin/admins/insert', "Admin\AdminsController@insert");
Route::get('/admin/admins/index', "Admin\AdminsController@index");
Route::get('/admin/admins/edit/{id}', "Admin\AdminsController@edit");
Route::post('/admin/admins/update', "Admin\AdminsController@update");
Route::get('/admin/admins/delete/{id}', "Admin\AdminsController@delete");
Route::post('/admin/admins/ajaxUpdate', "Admin\AdminsController@ajaxUpdate");

//商家管理
Route::controller('/admin/businesses', "Admin\BusinessesController");

//验证码
Route::get('/kit/captcha/{tmp}', 'Admin\KitController@captcha');

//登录
Route::get('/admin/login', "Admin\LoginController@login");
Route::post('/admin/dologin', "Admin\LoginController@dologin");
Route::get('/admin/logout', 'Admin\LoginController@logout');

//忘记密码
Route::get('/admin/reset/forget', 'Admin\ResetController@forget');
Route::post('/admin/reset/sendemail', 'Admin\ResetController@sendEmail');


Route::get('/admin/reset/newpass/id/{id}/token/{token}', "Admin\ResetController@newPass");
Route::get('/admin/reset/newbuspass/id/{id}/token/{token}', "Admin\ResetController@newBusPass");
Route::post('/admin/reset/renew', 'Admin\ResetController@renew');
Route::post('/admin/reset/busrenew', 'Admin\ResetController@busRenew');
//以上是王臣添加内容




//商品管理模块
Route::controller('/admin/goods','Admin\GoodsController');

//商家入驻信息
Route::get('kaidian', 'Home\KaidianController@index');//要删除，测试用
Route::post('/home/kaidian/sendemail', 'Home\KaidianController@sendEmail');
Route::get('/home/kaidian/register/email/{email}', 'Home\KaidianController@register');
Route::post('/home/kaidian/ajaxload', 'Home\KaidianController@ajaxLoad');
Route::post('/home/kaidian/second', 'Home\KaidianController@second');
Route::post('/home/kaidian/update', 'Home\KaidianController@update');
Route::get('/home/kaidian/index', 'Home\KaidianController@index');




//商家路由
// 这是后台
Route::get('business/index/index','Business\IndexController@index');
// 李佳奇
//商家管理商品
Route::get('/business/goods/add','Business\GoodsController@add');
Route::post('/business/goods/insert','Business\GoodsController@insert');
Route::get('/business/goods/index','Business\GoodsController@index');
Route::get('/business/goods/edit/{id}','Business\GoodsController@edit');
Route::post('/business/goods/update','Business\GoodsController@update');
Route::get('/business/goods/delete/{id}','Business\GoodsController@delete');
// 结束
//王臣开始
//business 路由

Route::get('/business/user/index','Business\UserController@index');
Route::get('/business/user/edit',"Business\UserController@edit");
Route::post('/business/user/update', "Business\UserController@update");
Route::get('/business/user/reset',"Business\RsetCodeController@reset");
Route::post('/business/user/renew', "Business\RsetCodeController@renew");
//王臣结束
/*
 * 尹天 09/11 星期天
 */
// TODO: 尹天开始
// 地址管理路由
Route::get('admin/address/add', 'Admin\AddressController@add');
Route::get('admin/address/index', 'Admin\AddressController@index');
Route::post('admin/address/index', 'Admin\AddressController@index');
Route::get('admin/address/delete/{id}', 'Admin\AddressController@delete');

// 管理员订单管理路由
Route::get('admin/order/add', 'Admin\OrderController@add');
Route::get('admin/order/index', 'Admin\OrderController@index');
Route::post('admin/order/index', 'Admin\OrderController@index');
Route::get('admin/order/delete/{id}', 'Admin\OrderController@delete');
Route::post('admin/order/ajaxUpdate', 'Admin\OrderController@ajaxUpdate');
// 商家订单管理路由
Route::get('business/order/add', 'Business\OrderController@add');
Route::get('business/order/index', 'Business\OrderController@index');
Route::post('business/order/index', 'Business\OrderController@index');
Route::get('business/order/delete/{id}', 'Business\OrderController@delete');
Route::post('business/order/ajaxUpdate', 'Business\OrderController@ajaxUpdate');

// 轮播图管理路由
Route::get('admin/scrolled/add', 'Admin\ScrolledController@add');
Route::get('admin/scrolled/index', 'Admin\ScrolledController@index');
Route::post('admin/scrolled/index', 'Admin\ScrolledController@index');
Route::post('admin/scrolled/insert', 'Admin\ScrolledController@insert');
Route::get('admin/scrolled/edit', 'Admin\ScrolledController@edit');
Route::post('admin/scrolled/update', 'Admin\ScrolledController@update');
Route::get('admin/scrolled/delete/{id}', 'Admin\ScrolledController@delete');


// 前台主页
Route::get('place/{address_code}', 'Home\IndexController@index');

// 前台商品列表页
Route::get('shop/{shop_id}', 'Home\ShopController@index');
Route::get('shop/cart/ajax', 'Home\ShopController@shopajax');

// 前台购物村订单却认页
Route::get('cart/checkout', 'Home\CartController@index');
Route::get('shop/cart_shop/ajax', 'Home\CartController@shopajax');
Route::post('shop/cart_shop_as/ajax', 'Home\CartController@shopajax_as');
Route::post('address/cart_shop/saveaddressajax', 'Home\AddressController@saveaddress');
Route::get('shop/islogin/ajax', 'Home\CartController@islogin');
Route::get('shop/initlogin/ajax', 'Home\CartController@initlogin');
Route::get('shop/logout/{from}', 'Home\CartController@logout');
Route::post('order/insert', 'Home\OrderController@insert');
Route::get('/order/complete/{order_id}', 'Home\OrderController@complete');



//王臣开始
// 用户注册页
Route::get('register', 'Home\UserController@register');
Route::post('register/ajaxEmail', 'Home\UserController@ajaxEmail');
Route::post('register/emailCheck', 'Home\UserController@emailCheck');
Route::post('/home/user/add', 'Home\UserController@add');
//验证码
Route::get('/kit/captcha/{tmp}', 'Home\KitController@captcha');

// 用户登录页
Route::get('login', 'Home\UserController@login');
Route::post('home/user/dologin', "Home\UserController@dologin");

// 个人中心
Route::get('profile', 'Home\ProfileController@index');
// 订单
Route::get('profile/order', 'Home\ProfileController@order');
Route::get('profile/order/unrated', 'Home\ProfileController@unrated');
// 个人信息
Route::get('profile/info', 'Home\ProfileController@info');







// 地址
Route::get('profile/address', 'Home\ProfileController@address');
Route::post('addaddress', 'Home\ProfileController@addAddress');
// 收藏
Route::get('profile/favor', 'Home\ProfileController@favor');


// 修改密码
Route::get('profile/security/changepassword', 'Home\SecurityController@changepassword');
Route::post('profile/security/dochange', 'Home\SecurityController@dochange');

// 服务中心
Route::get('support/center', 'Home\SupportController@center');

// 评价
Route::get('shop/{id}/rate', 'Home\RateController@rate');

// 布局测试
Route::get('layout', 'Home\ProfileController@layout');

// 尹天结束



//前台路由
// 李佳奇
// 前台商品分类展示列表页
Route::get('place/{address}', 'Home\IndexController@index');
Route::get('place/show/ajax', 'Home\IndexController@ajax');
Route::get('place/show/ajax2', 'Home\IndexController@ajax2');
Route::get('place/show/ajax3', 'Home\IndexController@ajax3');
Route::get('place/show/ajax4', 'Home\IndexController@ajax4');
// 前台商家商品列表页
Route::get('shop/{id}', 'Home\ShopController@index');
// 商家商品页
Route::get('/shop/sale', 'Home\ShopController@sale');
